﻿<Window x:Class="WPF101_Data.BindingHome"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WPF101_Data"        
    Title="Data Binding - DependencyObject" Height="302" Width="541" Loaded="Window_Loaded">
    <Window.Resources>
        <local:MyData x:Key="myData"></local:MyData>
        <local:MyData x:Key="myDataSource"></local:MyData>
    </Window.Resources>
    <Grid>
        <DockPanel>
            <Button DockPanel.Dock="Top" Name="colorObjectButton" Background="{Binding Path=ColorName}">Bind Background Color</Button>
            <Button DockPanel.Dock="Top" Name="demoXMLButton" Background="{Binding Path=SecondColor}">Bind Second Background Color</Button>
            <Button DockPanel.Dock="Top" Height="40" Content="{Binding Path=FirstText}"></Button>
            <Button DockPanel.Dock="Top" Width="{Binding Path=FirstWidth}">Bind to Width</Button>
            <TextBox DockPanel.Dock="Top" BorderThickness="{Binding Path=Thickness}" Text="{Binding Path=SecondText}"></TextBox>
            <TextBox DockPanel.Dock="Top" Text="{Binding Path=FirstText}"></TextBox>
            <TextBox Name="textUpdateSourceTrigger" DockPanel.Dock="Top" Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=FirstText}"></TextBox>
            <TextBox DockPanel.Dock="Top" Text="{Binding Source={StaticResource myDataSource}, Path=Name}"></TextBox>
            <TextBox DockPanel.Dock="Top" Text="{Binding ElementName=textUpdateSourceTrigger, Path=Text}"></TextBox>
        </DockPanel>
    </Grid>
</Window>
